﻿using System;
using System.Collections.Generic;

namespace Marmat.Data
{
    public partial class SQLBaseHelper
    {
        public class ColumnCollection : List<Column>
        {
            public Column Add(string ColumnName)
            {
                return this.Add(ColumnName, typeof(string), null, -1);
            }

            public Column Add(string ColumnName, string Value)
            {
                return this.Add(ColumnName, typeof(string), Value, -1);
            }

            public Column Add(string ColumnName, object Value, ValueEnum ValueEnum)
            {
                var Item = new Column();
                Item.ColumnName = ColumnName;
                Item.Value = Value;
                Item.ValueEnum = ValueEnum;
                Add(Item);
                return Item;
            }

            public Column Add(string ColumnName, Type DataType, object Value)
            {
                return this.Add(ColumnName, DataType, Value, -1);
            }

            public Column Add(string ColumnName, Type DataType, object Value, int MaxLength)
            {
                var Item = new Column();
                Item.ColumnName = ColumnName;
                Item.DataType = DataType;
                Item.Value = Value;
                Item.MaxLength = MaxLength;
                Add(Item);
                return Item;
            }
        }
    }

    public partial class SQLBaseHelper
    {
        public enum ValueEnum
        {
            Value = 0,
            Parameter = 1
        }
    }
}